#装饰器===================================================
# from functools import wraps
# import time
# def login(a,b):
#     def out(func):
#         @wraps(func)
#         def wrapperd(*args,**kwargs):
#             x = input("输入账号:")
#             y = input("输入密码:")
#             if x == a and y ==b:
#                 print("登陆成功")
#                 time.sleep(2)
#                 res = func(*args,**kwargs)
#                 return res
#             else:
#                 print("登陆失败")
#                 return "请重新输入"
#         return wrapperd
#     return out

# @login("qwq","123456")
# def qwq(x,y):
#     print("这个是一个指数运算器")
#     z =pow(x,y)
#     return z
# print(qwq(2,3))
#迭代器===================================================
# def myrange(start,end,step):
#     while start<end:
#         y = yield start
#         start = start+step
#         print(y+str(start))
        
# res = myrange(1,10,1)
# x = next(res)
# print("第一个数字为%d"%x)
# print(x)
# for i in range(8):
#     print(res.send("下一个数字为："))

#生成表达式===================================================
# a = 1
# b = 2
# x = (True if 1<2 else False)
# print(x)

# ls = [1,2,3,4,5,6,7,8]
# lt1 = [i*2 for i in ls ]
# lt2 = [i for i in ls if i%2==0]
# print(lt1)
# print(lt2)

# ls = [1,2,3,4,5,6,7,8]
# dic1 = {i:"qwq" for i in ls }
# print(dic1)
# ls2 = {1: 'qwq', 2: 'qwq', 3: 'qwq', 4: 'qwq', 5: 'qwq', 6: 'qwq', 7: 'qwq', 8: 'qwq'}
# # print(ls2.items())
# dic2 = {i:j for i,j in ls2.items() if i>5}
# print(dic2)

# gen = (i*2 for i in range(0,100000))
# for i in gen:
#     print(i)

#二分法===================================================
# ls = []
# for i in range(1,500):
#     ls.append(i)
# num = int(input())
# def qwq(ls):
#     print(ls)
#     if len(ls) == 1:
#         print("结果不存在")
#         return  
#     dex = len(ls)//2
#     if ls[dex]>num:
#         ls = ls[:dex]    
#         qwq(ls)
#     elif ls[dex]<num:
#         ls = ls[dex:]      
#         qwq(ls)
#     else:
#         print("找到了")
#         return
# qwq(ls)

#time模块===================================================
# import time
# sjc = time.time()
# xsh = time.localtime(sjc)
# gesh = time.strftime("%Y-%m-%d %H:%M:%S %p",xsh)
# print(gesh)

# gesh = "2021-09-11 21:20:27 PM"
# xsh = time.strptime(gesh,"%Y-%m-%d %H:%M:%S %p")
# sjc = time.mktime(xsh)
# print(sjc)

# import datetime
# x = datetime.datetime.now()
# print(x)
# y = x+datetime.timedelta(days = 3)
# print(y)

#hashlib模块===================================================
# import hashlib
# x = hashlib.sha3_512("qwq".encode("utf-8"))
# x.update("密码".encode("utf-8"))
# y = x.hexdigest()
# print(y)

#os模块===================================================
# import os
# x = os.path.dirname(os.path.dirname(__file__))
# print(x)
# y = os.path.isabs(__file__)
# print(y)
# os.rename(os.path.dirname("F:/python/安装.txt"),"安装教程.txt")
